Attribute VB_Name = "DateToTxt"
Sub dateconv()
    MsgBox DateToText("10/15/2011")
End Sub

Function DateToText(inDate) As String
    Dim mm As String
    Dim dd As String
    Dim yy As String
    Dim firstSlash As Integer
    Dim secondSlash As Integer
    
    '===================================================
    'Get Location of first and second slash (/) in date
    '===================================================
    firstSlash = InStr(1, inDate, "/", vbTextCompare)
    secondSlash = InStr(firstSlash + 1, inDate, "/", vbTextCompare)
        
        'Break if either slash (/) not found (meaning no value or not a date)
        '===================================================================
        If firstSlash = 0 Then Exit Function
            
    
    '===================================================
    '       Extract the date components as strings
    '===================================================

        ' Get month
        '============
        mm = Left(inDate, firstSlash - 1)
        
        ' Get day
        '==========
        dd = Left(Mid(inDate, firstSlash + 1), (secondSlash - firstSlash) - 1)
        
        ' Get year
        '===========
        yy = Right(inDate, 4)
    
        DateToText = mm & "\" & dd & "\" & yy
    
    'If
    '
    '    st = Left(ActiveCell.Offset(0, -1).Text, Len(ActiveCell.Offset(0, -1)))
    '    Range("l1") = st
End Function

